package android.example;

import java.util.List;

import android.graphics.drawable.Drawable;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

public class Map extends MapActivity{
	MapView mv; 
	List<Overlay> mapOverlays;
	Drawable d;
	ImageItemizedOverlay itemizedOverlay;
		
	@Override
	protected boolean isRouteDisplayed() {
		return false;
	}
		 
	/** Called when the activity is first created. */
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.map);
		mv = (MapView) findViewById(R.id.mapview);
		mv.setBuiltInZoomControls(true);
		/*위성으로 보여주기*/
		//mv.setSatellite(true);
		mv.setSatellite(false);

		mv.setTraffic(true);
		
		GeoPoint gp = new GeoPoint(37222281, 127187283);
		MapController mc = mv.getController();
		mc.animateTo(gp);
		mc.setZoom(16);
		
		mv.getOverlays().add(new StrOverlay());

		/***/
		mapOverlays = mv.getOverlays();   // mapview의 overlays 얻어온다
		d = this.getResources().getDrawable(R.drawable.point);
		itemizedOverlay = new ImageItemizedOverlay(d, this);  // overlay item 생성
		
		OverlayItem overlayitem = new OverlayItem(gp,"Dialog Title","This is message.... are you ok?");
		
		itemizedOverlay.addOverlay(overlayitem);  // item 객체를 overlay에 추가
		mapOverlays.add(itemizedOverlay);  // itemizedoverlay를 map overlays에 추가				
	}


}
